package com.woniuxy.java106crm.mapper;

import com.woniuxy.java106crm.entity.ServiceInvoice;
import com.woniuxy.java106crm.vo.SearchServiceVo;
import com.woniuxy.java106crm.vo.ServiceInvoiceVo;
import com.woniuxy.java106crm.vo.ServiceTypeCountVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ServiceInvoiceMapper {
    //创建服务单据
    void addServiceInvoice(ServiceInvoice serviceInvoice);
    //服务分配界面多条件查询所有单据
    List<ServiceInvoiceVo> queryServiceInvoice(SearchServiceVo searchServiceVo);
    //分配服务单据，修改对应单据的状态
    void updateAssignStatus(@Param("id") String id,@Param("status") String status,@Param("assigned")Integer assigned);
    //服务处理界面根据客户经理id查询状态为已分配的服务单据
    List<ServiceInvoiceVo> queryServiceInvoiceById(SearchServiceVo searchServiceVo);
    //修改客户经理处理的服务单据状态为已处理，填充处理时间字段
    void updateHandleStatus(@Param("id") String id,@Param("handleWay")String handleWay,@Param("status") String status);
    //服务反馈界面根据客户经理id查询状态为已处理的服务单据
    List<ServiceInvoiceVo> queryServiceInvoiceByIdAndStatus(SearchServiceVo searchServiceVo);
    //服务反馈，填充字段mark的评分
    //反馈结果,根据满意度修改单据状态
    void updateMarks(@Param("id")String id,@Param("mark")Integer mark,@Param("status")String status,@Param("content") String content);


    //修改单据状态为已归档
    void updateStatus(@Param("id")String id,@Param("status") String status);
    //查询所有已反馈已归档的服务单据
    List<ServiceInvoiceVo> queryServiceInvoiceByStatus(@Param("status1")String status1,@Param("status2")String status2);

    //客服服务分析根据类型统计
    List<ServiceTypeCountVo> ServiceTypeCount(String year);
}
